<?php

class ScalarModel extends PathModel
{

    private $type;

    function __construct($type, $path, $c)
    {
        parent::__construct($path, $c);
        $this->type = $type;
    }

    function verify($value)
    {
        $func = 'is_' . $this->type;
        if (!$func($value)) {
            throw new IllegalModelException(
                "Expect $this->type", $this->path, $this->c->getName());
        }
    }

}
